package fr.boina.upmc.android;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class Gift2friendActivity extends Activity {
	
	private static String TAG = "Gift2friendActivity";
	private CharSequence text;
	private Toast toast;
	
	 Button valide;
	 Button cancel;
	 TextView identifiant;
	TextView password;
	
	
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
       
        valide = (Button)findViewById(R.id.idValider);
        cancel = (Button)findViewById(R.id.idCancel);
        identifiant = (TextView)findViewById(R.id.idIdentifiant);
        password = (TextView)findViewById(R.id.idPassword);
        
        
        valide.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				Log.i(TAG, "#Annulation du formulaire");
				
				//Intent intent = new Intent();
				
				Context context = getApplicationContext();
				text = "Valider forms ...";
				toast = Toast.makeText(context, text, Toast.LENGTH_SHORT);
				toast.show();
			}
		});
        
        cancel.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Log.e(TAG, "#Annulation du formulaire");
				
				identifiant.setText("");
				password.setText("");
				
				Context context = getApplicationContext();
				text = "Cancel forms ...";
				toast = Toast.makeText(context, text, Toast.LENGTH_SHORT);
				toast.show();
			}
		});
    }
}